Skip to content

[CMake] '-no-emit-module-separately-wmo' for swift modules #3012

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 17, 2025

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Mar 11, 2025

Emitting modules in separate frontend job doesn't give any benefits because single add_library is just a single job from CMake's point of view. Clients need to wait for .dylib/.so being emitted before using the .swiftmodule. Not emitting modules separately is actually faster in CMake because it doesn't parse and typecheck the source code twice.

Emitting modules in separate frontend job doesn't give any benefits
because single add_library is just a single job from CMake's point of
view. Clients need to wait for `.dylib`/`.so` being emitted before using
the `.swiftmodule`. *Not* emitting modules separately is actually faster
in CMake because it doesn't parse and typecheck the source code twice.
@rintaro
Copy link
Member Author

rintaro commented Mar 11, 2025

@swift-ci Please test

@rintaro
Copy link
Member Author

rintaro commented Mar 12, 2025

@swift-ci Please test Windows

@rintaro rintaro merged commit b66e024 into swiftlang:main Mar 17, 2025
25 checks passed
@rintaro rintaro deleted the cmake-no-emit-module-separately branch March 17, 2025 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants